package ink.yuanchu.picachoframework.controller;


import ink.yuanchu.picachoframework.dao.RoleMapper;
import ink.yuanchu.picachoframework.entity.Role;
import ink.yuanchu.picachoframework.message.ResultBody;
import ink.yuanchu.picachoframework.service.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ziyuan
 * @since 2021-02-20
 */
@RestController
@RequestMapping("/picachoframework/beckendRole")
@Api("角色控制类")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @GetMapping("/getRoleAll")
    @ApiOperation(value = "查询所有角色 排除所有逻辑删除的",notes = "")
    public ResultBody getRole(){
        List<Role> roles = roleService.selectAll();
        return ResultBody.success(roles);
    }

    @GetMapping("/getRoleAndPermission")
    @ApiOperation(value = "",notes = "")
    public ResultBody getRoleAndPermission(){
        return ResultBody.success(roleService.getRoleAndPermission());
    }
}

